// import Layout from "../layout/index"
// import Add from "../pages/test-add-router"

let userData = {
  code: 2000,
  msg: 'success',
  data: { //数据
    name: "@cname",
    id: '@guid',
    job: 'Web前端'
  }
}
let useRouters = [
  {
    // path: '/',
    // component: Layout,
    // redirect: '/home',
    // children: [
    //   {
    //     path: '/add',
    //     name: 'Home',
    //     component: Add
    //   }
    // ]
  }
]

export default [
  {
    type: 'get',
    url: '/api/getUser',
    response: () => {
      return userData
    }
  },
  {
    type: 'get',
    url: '/api/getRouter',
    response: () => {
      return useRouters
    }
  },
  {
    type: 'post',
    url: '/api/userLogin',
    response: config => {
      const {name, password} = config.body
      let data = {}
      if (name==='wenhui' && password==='81dc9bdb52d04dc20036dbd8313ed055'){
        data = {
          code: 2000,
          message: 'success',
          data: {
            name,
            password
          }
        }
      } else {
        data = {
          code: 5000,
          message: '用户名密码错误',
          data: {}
        }
      }
      return data
    }
  }
]
